3.7.66 \(\int \frac {\sqrt {e \cos (c+d x)}}{(a+i a \tan (c+d x))^2} \, dx\) [666]

Optimal. Leaf size=120 \[ \frac {2 \sqrt {e \cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 a^2 d \sqrt {\cos (c+d x)}}+\frac {2 i \sqrt {e \cos (c+d x)}}{9 d (a+i a \tan (c+d x))^2}+\frac {2 i \sqrt {e \cos (c+d x)}}{9 d \left (a^2+i a^2 \tan (c+d x)\right )} \]

[Out]

2/3*(cos(1/2*d*x+1/2*c)^2)^(1/2)/cos(1/2*d*x+1/2*c)*EllipticE(sin(1/2*d*x+1/2*c),2^(1/2))*(e*cos(d*x+c))^(1/2)
/a^2/d/cos(d*x+c)^(1/2)+2/9*I*(e*cos(d*x+c))^(1/2)/d/(a+I*a*tan(d*x+c))^2+2/9*I*(e*cos(d*x+c))^(1/2)/d/(a^2+I*
a^2*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 126, normalized size of antiderivative = 1.05, number of steps used = 5, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3596, 3581, 3854, 3856, 2719} \begin {gather*} \frac {4 i \cos ^2(c+d x) \sqrt {e \cos (c+d x)}}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {2 \sin (c+d x) \cos (c+d x) \sqrt {e \cos (c+d x)}}{9 a^2 d}+\frac {2 E\left (\left .\frac {1}{2} (c+d x)\right |2\right ) \sqrt {e \cos (c+d x)}}{3 a^2 d \sqrt {\cos (c+d x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[e*Cos[c + d*x]]/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(2*Sqrt[e*Cos[c + d*x]]*EllipticE[(c + d*x)/2, 2])/(3*a^2*d*Sqrt[Cos[c + d*x]]) + (2*Cos[c + d*x]*Sqrt[e*Cos[c
 + d*x]]*Sin[c + d*x])/(9*a^2*d) + (((4*I)/9)*Cos[c + d*x]^2*Sqrt[e*Cos[c + d*x]])/(d*(a^2 + I*a^2*Tan[c + d*x
]))

Rule 2719

Int[Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[(2/d)*EllipticE[(1/2)*(c - Pi/2 + d*x), 2], x] /; FreeQ[{
c, d}, x]

Rule 3581

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[2*d^2*
(d*Sec[e + f*x])^(m - 2)*((a + b*Tan[e + f*x])^(n + 1)/(b*f*(m + 2*n))), x] - Dist[d^2*((m - 2)/(b^2*(m + 2*n)
)), Int[(d*Sec[e + f*x])^(m - 2)*(a + b*Tan[e + f*x])^(n + 2), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a
^2 + b^2, 0] && LtQ[n, -1] && ((ILtQ[n/2, 0] && IGtQ[m - 1/2, 0]) || EqQ[n, -2] || IGtQ[m + n, 0] || (Integers
Q[n, m + 1/2] && GtQ[2*m + n + 1, 0])) && IntegerQ[2*m]

Rule 3596

Int[(cos[(e_.) + (f_.)*(x_)]*(d_.))^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[(d*Co
s[e + f*x])^m*(d*Sec[e + f*x])^m, Int[(a + b*Tan[e + f*x])^n/(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e,
f, m, n}, x] &&  !IntegerQ[m]

Rule 3854

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[Cos[c + d*x]*((b*Csc[c + d*x])^(n + 1)/(b*d*n)), x
] + Dist[(n + 1)/(b^2*n), Int[(b*Csc[c + d*x])^(n + 2), x], x] /; FreeQ[{b, c, d}, x] && LtQ[n, -1] && Integer
Q[2*n]

Rule 3856

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Dist[(b*Csc[c + d*x])^n*Sin[c + d*x]^n, Int[1/Sin[c + d
*x]^n, x], x] /; FreeQ[{b, c, d}, x] && EqQ[n^2, 1/4]

Rubi steps

\begin {align*} \int \frac {\sqrt {e \cos (c+d x)}}{(a+i a \tan (c+d x))^2} \, dx &=\left (\sqrt {e \cos (c+d x)} \sqrt {e \sec (c+d x)}\right ) \int \frac {1}{\sqrt {e \sec (c+d x)} (a+i a \tan (c+d x))^2} \, dx\\ &=\frac {4 i \cos ^2(c+d x) \sqrt {e \cos (c+d x)}}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {\left (5 e^2 \sqrt {e \cos (c+d x)} \sqrt {e \sec (c+d x)}\right ) \int \frac {1}{(e \sec (c+d x))^{5/2}} \, dx}{9 a^2}\\ &=\frac {2 \cos (c+d x) \sqrt {e \cos (c+d x)} \sin (c+d x)}{9 a^2 d}+\frac {4 i \cos ^2(c+d x) \sqrt {e \cos (c+d x)}}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {\left (\sqrt {e \cos (c+d x)} \sqrt {e \sec (c+d x)}\right ) \int \frac {1}{\sqrt {e \sec (c+d x)}} \, dx}{3 a^2}\\ &=\frac {2 \cos (c+d x) \sqrt {e \cos (c+d x)} \sin (c+d x)}{9 a^2 d}+\frac {4 i \cos ^2(c+d x) \sqrt {e \cos (c+d x)}}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {\sqrt {e \cos (c+d x)} \int \sqrt {\cos (c+d x)} \, dx}{3 a^2 \sqrt {\cos (c+d x)}}\\ &=\frac {2 \sqrt {e \cos (c+d x)} E\left (\left .\frac {1}{2} (c+d x)\right |2\right )}{3 a^2 d \sqrt {\cos (c+d x)}}+\frac {2 \cos (c+d x) \sqrt {e \cos (c+d x)} \sin (c+d x)}{9 a^2 d}+\frac {4 i \cos ^2(c+d x) \sqrt {e \cos (c+d x)}}{9 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 4 in optimal.
time = 1.88, size = 420, normalized size = 3.50 \begin {gather*} \frac {\sqrt {e \cos (c+d x)} (\cos (d x)+i \sin (d x))^2 \left (\frac {2 \sqrt {2} e^{-i d x} \csc (c) \left (3+3 e^{2 i (c+d x)}+3 \sqrt {1-i e^{i (c+d x)}} \sqrt {e^{i (c+d x)} \left (-i+e^{i (c+d x)}\right )} E\left (\left .\text {ArcSin}\left (\sqrt {-i \cos (c+d x)+\sin (c+d x)}\right )\right |-1\right )-3 \sqrt {1-i e^{i (c+d x)}} \sqrt {e^{i (c+d x)} \left (-i+e^{i (c+d x)}\right )} F\left (\left .\text {ArcSin}\left (\sqrt {-i \cos (c+d x)+\sin (c+d x)}\right )\right |-1\right )+e^{2 i d x} \sqrt {1+e^{2 i (c+d x)}} \, _2F_1\left (\frac {1}{2},\frac {3}{4};\frac {7}{4};-e^{2 i (c+d x)}\right )\right ) (\cos (2 c)+i \sin (2 c))}{9 \sqrt {e^{-i (c+d x)} \left (1+e^{2 i (c+d x)}\right )}}-\frac {1}{9} \sqrt {\cos (c+d x)} \csc (c) (\cos (2 d x)-i \sin (2 d x)) (7 \cos (c+2 d x)+5 \cos (3 c+2 d x)-4 i (\sin (c)-2 \sin (c+2 d x)-\sin (3 c+2 d x)))\right )}{2 d \cos ^{\frac {5}{2}}(c+d x) (a+i a \tan (c+d x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[e*Cos[c + d*x]]/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(Sqrt[e*Cos[c + d*x]]*(Cos[d*x] + I*Sin[d*x])^2*((2*Sqrt[2]*Csc[c]*(3 + 3*E^((2*I)*(c + d*x)) + 3*Sqrt[1 - I*E
^(I*(c + d*x))]*Sqrt[E^(I*(c + d*x))*(-I + E^(I*(c + d*x)))]*EllipticE[ArcSin[Sqrt[(-I)*Cos[c + d*x] + Sin[c +
 d*x]]], -1] - 3*Sqrt[1 - I*E^(I*(c + d*x))]*Sqrt[E^(I*(c + d*x))*(-I + E^(I*(c + d*x)))]*EllipticF[ArcSin[Sqr
t[(-I)*Cos[c + d*x] + Sin[c + d*x]]], -1] + E^((2*I)*d*x)*Sqrt[1 + E^((2*I)*(c + d*x))]*Hypergeometric2F1[1/2,
 3/4, 7/4, -E^((2*I)*(c + d*x))])*(Cos[2*c] + I*Sin[2*c]))/(9*E^(I*d*x)*Sqrt[(1 + E^((2*I)*(c + d*x)))/E^(I*(c
 + d*x))]) - (Sqrt[Cos[c + d*x]]*Csc[c]*(Cos[2*d*x] - I*Sin[2*d*x])*(7*Cos[c + 2*d*x] + 5*Cos[3*c + 2*d*x] - (
4*I)*(Sin[c] - 2*Sin[c + 2*d*x] - Sin[3*c + 2*d*x])))/9))/(2*d*Cos[c + d*x]^(5/2)*(a + I*a*Tan[c + d*x])^2)

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 276 vs. \(2 (128 ) = 256\).
time = 1.41, size = 277, normalized size = 2.31

method result size
default \(\frac {2 e \left (-64 i \left (\sin ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+64 \left (\sin ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+160 i \left (\sin ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-128 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-160 i \left (\sin ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+104 \cos \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (\sin ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+80 i \left (\sin ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-40 \left (\sin ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )-20 i \left (\sin ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+6 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \cos \left (\frac {d x}{2}+\frac {c}{2}\right )+3 \sqrt {\frac {1}{2}-\frac {\cos \left (d x +c \right )}{2}}\, \sqrt {2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-1}\, \EllipticE \left (\cos \left (\frac {d x}{2}+\frac {c}{2}\right ), \sqrt {2}\right )+2 i \sin \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{9 a^{2} \sin \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {-2 \left (\sin ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) e +e}\, d}\) \(277\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*cos(d*x+c))^(1/2)/(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

2/9/a^2/sin(1/2*d*x+1/2*c)/(-2*sin(1/2*d*x+1/2*c)^2*e+e)^(1/2)*e*(-64*I*sin(1/2*d*x+1/2*c)^11+64*sin(1/2*d*x+1
/2*c)^10*cos(1/2*d*x+1/2*c)+160*I*sin(1/2*d*x+1/2*c)^9-128*cos(1/2*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^8-160*I*sin(1
/2*d*x+1/2*c)^7+104*cos(1/2*d*x+1/2*c)*sin(1/2*d*x+1/2*c)^6+80*I*sin(1/2*d*x+1/2*c)^5-40*sin(1/2*d*x+1/2*c)^4*
cos(1/2*d*x+1/2*c)-20*I*sin(1/2*d*x+1/2*c)^3+6*sin(1/2*d*x+1/2*c)^2*cos(1/2*d*x+1/2*c)+3*(sin(1/2*d*x+1/2*c)^2
)^(1/2)*(2*sin(1/2*d*x+1/2*c)^2-1)^(1/2)*EllipticE(cos(1/2*d*x+1/2*c),2^(1/2))+2*I*sin(1/2*d*x+1/2*c))/d

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*cos(d*x+c))^(1/2)/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: THROW: The catch RAT-ERR is undefined.

________________________________________________________________________________________

Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.09, size = 103, normalized size = 0.86 \begin {gather*} \frac {{\left (\sqrt {\frac {1}{2}} {\left (i \, e^{\frac {1}{2}} + 15 i \, e^{\left (4 i \, d x + 4 i \, c + \frac {1}{2}\right )} + 4 i \, e^{\left (2 i \, d x + 2 i \, c + \frac {1}{2}\right )}\right )} \sqrt {e^{\left (2 i \, d x + 2 i \, c\right )} + 1} e^{\left (-\frac {1}{2} i \, d x - \frac {1}{2} i \, c\right )} + 12 i \, \sqrt {2} e^{\left (4 i \, d x + 4 i \, c + \frac {1}{2}\right )} {\rm weierstrassZeta}\left (-4, 0, {\rm weierstrassPInverse}\left (-4, 0, e^{\left (i \, d x + i \, c\right )}\right )\right )\right )} e^{\left (-4 i \, d x - 4 i \, c\right )}}{18 \, a^{2} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*cos(d*x+c))^(1/2)/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/18*(sqrt(1/2)*(I*e^(1/2) + 15*I*e^(4*I*d*x + 4*I*c + 1/2) + 4*I*e^(2*I*d*x + 2*I*c + 1/2))*sqrt(e^(2*I*d*x +
 2*I*c) + 1)*e^(-1/2*I*d*x - 1/2*I*c) + 12*I*sqrt(2)*e^(4*I*d*x + 4*I*c + 1/2)*weierstrassZeta(-4, 0, weierstr
assPInverse(-4, 0, e^(I*d*x + I*c))))*e^(-4*I*d*x - 4*I*c)/(a^2*d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {\int \frac {\sqrt {e \cos {\left (c + d x \right )}}}{\tan ^{2}{\left (c + d x \right )} - 2 i \tan {\left (c + d x \right )} - 1}\, dx}{a^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*cos(d*x+c))**(1/2)/(a+I*a*tan(d*x+c))**2,x)

[Out]

-Integral(sqrt(e*cos(c + d*x))/(tan(c + d*x)**2 - 2*I*tan(c + d*x) - 1), x)/a**2

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*cos(d*x+c))^(1/2)/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

integrate(sqrt(cos(d*x + c))*e^(1/2)/(I*a*tan(d*x + c) + a)^2, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sqrt {e\,\cos \left (c+d\,x\right )}}{{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^2} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((e*cos(c + d*x))^(1/2)/(a + a*tan(c + d*x)*1i)^2,x)

[Out]

int((e*cos(c + d*x))^(1/2)/(a + a*tan(c + d*x)*1i)^2, x)

________________________________________________________________________________________